package lcr;

import java.util.ArrayList;
import java.util.List;

public class Test0079 {
}

class Solution0079_1 {
    List<List<Integer>> ans = new ArrayList<>();
    public List<List<Integer>> subsets(int[] nums) {
        traceback(nums,0,new ArrayList<>());
        return ans;
    }

    public void traceback(int[] nums,int index,List<Integer> list){
        ans.add(new ArrayList<>(list));

        for (int i = index; i < nums.length; i++) {
            list.add(nums[i]);

            traceback(nums,index+1,list);

            list.remove(list.size()-1);
        }

    }


}
